package com.guanmi.ethereum.service;

import com.guanmi.ethereum.domain.WalletResponseEntity;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.core.methods.response.EthTransaction;

import java.math.BigInteger;
import java.util.List;

public interface EthereumService {

	/**
	 * @Title: getAccountlist
	 * @Description: 获取账户列表
	 * @return List<String>
	 */
	WalletResponseEntity<List<String>> getAccountlist();

	/**
	 * @Title: generateNewWalletFile
	 * @Description: 创建账户
	 * @param password:密码
	 * @return String
	 */
	WalletResponseEntity<Credentials> generateNewWalletFile(String password);

	/**
	 * @Title: getBalance
	 * @Description: 获取用户余额
	 * @param address:账户
	 * @return BigInteger
	 */
	WalletResponseEntity<BigInteger> getBalance(String address);

	/**
	 * @Title: getTransactionCount
	 * @Description: 获取用户交易记录数
	 * @param address:账户
	 * @return BigInteger
	 */
	WalletResponseEntity<BigInteger> getTransactionCount(String address);

	/**
	 * @Title: getTransaction
	 * @Description: 获取交易信息
	 * @param transactionHash:交易的hash值
	 * @return EthTransaction
	 */
	WalletResponseEntity<EthTransaction> getTransaction(String transactionHash);

	/**
	 * @Description: 获取用户的账户 @param walletfile:密钥文件 @param password：密码 @return
	 * String @throws
	 */
	WalletResponseEntity<String> getAddress(String walletfile, String password);
}
